const seq = require('sequelize')
const time = require('../time')

module.exports = {
  NAME: 'data_etl',
  TABLE: {
    data_etl_id: {
      type: seq.INTEGER(11),
      primaryKey: true,
      unique: true,
      autoIncrement: true,
      comment: 'data_etl_id 主键，自增',
      field: 'data_etl_id' //  相应的字段名称
    },
    name: {
      type: seq.STRING(64),
      comment: 'etl名称',
      field: 'name'
    },
    data_source_id: {
      type: seq.INTEGER(11),
      comment: 'data_source_id 主键，自增',
      field: 'data_source_id' //  相应的字段名称
    },
    content: {
      type: seq.TEXT,
      comment: 'content',
      field: 'content',
      defaultValue: () => {
        return "{\"nodeList\": [],\"lineList\": []}"
      }
    },
    remark: {
      type: seq.TEXT,
      comment: 'remark',
      field: 'remark'
    },
    status: {
      type: seq.INTEGER(2),
      comment: 'etl 是否完成 0(未完成) 1(完成)',
      field: 'status'
    },
    ...time.create_date,
    ...time.update_date,
    ...time.delete_date,
    ...time.create_by,
    ...time.update_by,
    ...time.delete_by
  }
}
